{% extends "../base.html" %}

{% block title %}Edit participant{% endblock %}
{% block header %}Edit participant{% endblock %}

{% block content %}
		<a href="/projects">Projects</a>/
		<a href="/editProjectForm?projectId={{ participant.project.key }}">Project</a>/
		<a href="/participants?projectId={{ participant.project.key }}">Participants</a>

		<form method="POST" action="/saveParticipant">
			<table>
				<tr>
					<td>
						<label for="email" >Email: </label>
					</td>
					<td>
						<input id="email" name="email" value="{{ participant.user.email}}"></input>		
					</td>
					<td>
						<label >Roles: </label>
					</td>
					<td>
						<table>
						
						{% for role in roles %}
						<tr>
								{% if role.checked %}
									<td><input type="checkbox" name="{{role.role.key}}" checked="checked"></input></td>
									<td>{{ role.role.name }}</td>
								{% else %}
									<td><input type="checkbox" name="{{role.role.key}}" ></input></td>
									<td>{{ role.role.name }}</td>
								{% endif %}
						</tr>
						
						{% endfor %}
						</table>		
					</td>
					
				</tr>
			</table>
			
			<input name="participantId" type="hidden" value="{{ participant.key }}"></input>
			<input type="submit" value="Save"></input>
		</form>
{% endblock %}
